
/**
 * @class Ext.ux.UrlBuilder
 * Builds URLs...
 */
Ext.ux.UrlBuilder = function() {

};

Ext.ux.UrlBuilder.prototype = {
	/**
	 * @property hosts
	 * @type Object
	 * An array of different host types we can have
	 */
	hosts	: {
		'resources'	: 'http://resources.dev.kohive.local/'
	},

	/**
	 * Function description
	 * @param {String} host The type of URL we need to build
	 * @param {String} append The string we want to append to the end of the URL
	 * @return {String} The appened URL
	 */
	build	: function(host, append) {
		// Check if the rsources have been generated if not use the default hosts
		if (typeof KohiveResourceUrls != "undefined") {
			this.hosts = KohiveResourceUrls;
		};

		// Check if the host is defined
		// @see hosts
		if (!this.hosts[host]) {
			return;
		};

		// TODO always http? what about https?
		var scheme = 'http';
		// Return the appended URL
		// return scheme + '://' + this.hosts[host] + '/' + append;
		return append;
	}
};

Ext.ux.UrlBuilder = new Ext.ux.UrlBuilder();